<?php

namespace app\services;

use plugin\admin\app\model\User;
use plugin\admin\app\model\UserFollowing;
use plugin\admin\app\model\UserProfile;
use plugin\admin\app\model\Video;

class SearchService
{
    const TYPE_USER = 1;

    const TYPE_VIDEO = 2;

    public static function search($keyword, $type, $page = 1, $length = 10)
    {
        if ($type == self::TYPE_USER) {
            return UserService::search($keyword, $page, $length);
        } else {
            return VideoService::search($keyword, $page, $length);
        }
    }
}